package com.yuankun.chat.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author：yuankun
 * @Package：com.yuankun.chat.config
 * @Project：chat
 * @name：WebMvcConfiguration
 * @Date：2025/8/17 18:38
 * @Filename：WebMvcConfiguration
 */
@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry
                .addMapping("/**").allowedOrigins("*")
                .allowedMethods("OPTIONS", "GET", "POST","PUT","DELETE").allowedHeaders("*");
    }
}
